package rcs34.android.AndroidRC.Receivers;

import rcs34.android.AndroidRC.ServiceSender;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class ARCBroadcastReceiver extends BroadcastReceiver {
  @Override
  public void onReceive(Context context, Intent intent) {
    //System.out.println(intent.getAction());
    if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
      fireBattIntent(context,intent);
    }
  }
  
  public static void fireBattIntent(Context _context, Intent _intent){
    Intent i = new Intent(_context, ServiceSender.class);
    i.putExtra(ServiceSender.KEY_CMD, ServiceSender.CHANGE_BATT);
    i.putExtras(_intent);
    _context.startService(i);
  }
}
